// ////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Do file for analyses for Discrediting on Three Dimensions paper
// ////////////////////////////////////////////////////////////////////////////////////////////////////////////

// Set this to whatever directory contains the do file and Three Dimensions dataset
cd "c:\temp"


use "ThreeDimensions_ReplicationData.dta", clear

// Dropping respondents that were exposed too briefly, or ridiculously long
drop if c1_timer_Page_Submit > 500 & !missing(c1_timer_Page_Submit)
drop if c1_timer_Page_Submit < 30  & !missing(c1_timer_Page_Submit)  

drop if c2_timer_Page_Submit >  500 & !missing(c2_timer_Page_Submit)
drop if c2_timer_Page_Submit < 30   & !missing(c2_timer_Page_Submit)

drop if c3_timer_Page_Submit >  500 & !missing(c3_timer_Page_Submit)
drop if c3_timer_Page_Submit < 30   & !missing(c3_timer_Page_Submit)

drop if c4_timer_Page_Submit >  500 & !missing(c4_timer_Page_Submit)
drop if c4_timer_Page_Submit < 30   & !missing(c4_timer_Page_Submit)

drop if c5_timer_Page_Submit >  500 & !missing(c5_timer_Page_Submit)
drop if c5_timer_Page_Submit < 30   & !missing(c5_timer_Page_Submit)

drop if c6_timer_Page_Submit >  500 & !missing(c6_timer_Page_Submit)
drop if c6_timer_Page_Submit < 30   & !missing(c6_timer_Page_Submit)

drop if c7_timer_Page_Submit >  500 & !missing(c7_timer_Page_Submit)
drop if c7_timer_Page_Submit <30    & !missing(c7_timer_Page_Submit)

drop if c8_timer_Page_Submit >  500 & !missing(c8_timer_Page_Submit)
drop if c8_timer_Page_Submit <30    & !missing(c8_timer_Page_Submit)

drop if c9_timer_Page_Submit >  500 & !missing(c9_timer_Page_Submit)
drop if c9_timer_Page_Submit <30    & !missing(c9_timer_Page_Submit)

drop if c10_timer_Page_Submit >  500 & !missing(c10_timer_Page_Submit)
drop if c10_timer_Page_Submit <30    & !missing(c10_timer_Page_Submit)

drop if c11_timer_Page_Submit >  500 & !missing(c11_timer_Page_Submit)
drop if c11_timer_Page_Submit <30    & !missing(c11_timer_Page_Submit)

drop if c12_timer_Page_Submit >  500 & !missing(c12_timer_Page_Submit)
drop if c12_timer_Page_Submit <30    & !missing(c12_timer_Page_Submit)

drop if c13_timer_Page_Submit >  500 & !missing(c13_timer_Page_Submit)
drop if c13_timer_Page_Submit <30    & !missing(c13_timer_Page_Submit)

drop if c14_timer_Page_Submit >  500 & !missing(c14_timer_Page_Submit)
drop if c14_timer_Page_Submit <30    & !missing(c14_timer_Page_Submit)

drop if c15_timer_Page_Submit >  500 & !missing(c15_timer_Page_Submit)
drop if c15_timer_Page_Submit <30    & !missing(c15_timer_Page_Submit)

drop if c16_timer_Page_Submit >  500 & !missing(c16_timer_Page_Submit)
drop if c16_timer_Page_Submit <30    & !missing(c16_timer_Page_Submit)

drop if c17_timer_Page_Submit >  500 & !missing(c17_timer_Page_Submit)
drop if c17_timer_Page_Submit <30    & !missing(c17_timer_Page_Submit)

drop if c18_timer_Page_Submit >  500 & !missing(c18_timer_Page_Submit)
drop if c18_timer_Page_Submit <30    & !missing(c18_timer_Page_Submit)

drop if c19_timer_Page_Submit >  500 & !missing(c19_timer_Page_Submit)
drop if c19_timer_Page_Submit <30    & !missing(c19_timer_Page_Submit)

drop if c20_timer_Page_Submit >  500 & !missing(c20_timer_Page_Submit)
drop if c20_timer_Page_Submit <30    & !missing(c20_timer_Page_Submit)

drop if c21_timer_Page_Submit >  500 & !missing(c21_timer_Page_Submit)
drop if c21_timer_Page_Submit <30    & !missing(c21_timer_Page_Submit)

drop if c22_timer_Page_Submit >  500 & !missing(c22_timer_Page_Submit)
drop if c22_timer_Page_Submit <30    & !missing(c22_timer_Page_Submit)

drop if c23_timer_Page_Submit >  500 & !missing(c23_timer_Page_Submit)
drop if c23_timer_Page_Submit <30    & !missing(c23_timer_Page_Submit)

drop if c24_timer_Page_Submit >  500 & !missing(c24_timer_Page_Submit)
drop if c24_timer_Page_Submit <30    & !missing(c24_timer_Page_Submit)

// Testing whether respondents correctly identify the parties mentioned in the Article
label var W2_PartyMentioned_1 "Party Mentioned in Article - CD&V"
label var W2_PartyMentioned_2 "Party Mentioned in Article - Groen"
label var W2_PartyMentioned_3 "Party Mentioned in Article - N-VA"
label var W2_PartyMentioned_4 "Party Mentioned in Article - VLD"
label var W2_PartyMentioned_5 "Party Mentioned in Article - PvdA"
label var W2_PartyMentioned_6 "Party Mentioned in Article - SpA"
label var W2_PartyMentioned_7 "Party Mentioned in Article - VB"

drop if (Condition == 1 | Condition == 3 | Condition == 5) & (W2_PartyMentioned_1 == 1 | W2_PartyMentioned_2 == 1 | W2_PartyMentioned_3 == 2 | W2_PartyMentioned_4 == 2 | W2_PartyMentioned_5 == 2 | W2_PartyMentioned_6 == 2 | W2_PartyMentioned_7 == 2)
drop if (Condition == 2 | Condition == 4 | Condition == 6) & (W2_PartyMentioned_1 == 1 | W2_PartyMentioned_2 == 2 | W2_PartyMentioned_3 == 2 | W2_PartyMentioned_4 == 2 | W2_PartyMentioned_5 == 2 | W2_PartyMentioned_6 == 2 | W2_PartyMentioned_7 == 2)
drop if (Condition == 7 | Condition == 9 | Condition == 11) & (W2_PartyMentioned_1 == 1 | W2_PartyMentioned_2 == 2 | W2_PartyMentioned_3 == 2 | W2_PartyMentioned_4 == 2 | W2_PartyMentioned_5 == 2 | W2_PartyMentioned_6 == 1 | W2_PartyMentioned_7 == 2)
drop if (Condition == 8 | Condition == 10 | Condition == 12) & (W2_PartyMentioned_1 == 1 | W2_PartyMentioned_2 == 2 | W2_PartyMentioned_3 == 2 | W2_PartyMentioned_4 == 2 | W2_PartyMentioned_5 == 2 | W2_PartyMentioned_6 == 2 | W2_PartyMentioned_7 == 2)
drop if (Condition == 13 | Condition == 15 | Condition == 17) & (W2_PartyMentioned_1 == 2 | W2_PartyMentioned_2 == 2 | W2_PartyMentioned_3 == 1 | W2_PartyMentioned_4 == 2 | W2_PartyMentioned_5 == 2 | W2_PartyMentioned_6 == 2 | W2_PartyMentioned_7 == 1)
drop if (Condition == 14 | Condition == 16 | Condition == 18) & (W2_PartyMentioned_1 == 2 | W2_PartyMentioned_2 == 2 | W2_PartyMentioned_3 == 2 | W2_PartyMentioned_4 == 2 | W2_PartyMentioned_5 == 2 | W2_PartyMentioned_6 == 2 | W2_PartyMentioned_7 == 1)
drop if (Condition == 19 | Condition == 21 | Condition == 23) & (W2_PartyMentioned_1 == 2 | W2_PartyMentioned_2 == 2 | W2_PartyMentioned_3 == 1 | W2_PartyMentioned_4 == 1 | W2_PartyMentioned_5 == 2 | W2_PartyMentioned_6 == 2 | W2_PartyMentioned_7 == 2)
drop if (Condition == 20 | Condition == 22 | Condition == 24) & (W2_PartyMentioned_1 == 2 | W2_PartyMentioned_2 == 2 | W2_PartyMentioned_3 == 1 | W2_PartyMentioned_4 == 2 | W2_PartyMentioned_5 == 2 | W2_PartyMentioned_6 == 2 | W2_PartyMentioned_7 == 2)

// Renaming variables for the reshape

rename W1_Comp_Envi_1 W1_Comp_17 
rename W1_Comp_Envi_2 W1_Comp_27
rename W1_Comp_Envi_3 W1_Comp_37
rename W1_Comp_Envi_4 W1_Comp_47
rename W1_Comp_Envi_5 W1_Comp_57
rename W1_Comp_Envi_6 W1_Comp_67
rename W1_Comp_Envi_7 W1_Comp_77
rename W1_Comp_Empl_1 W1_Comp_1103
rename W1_Comp_Empl_2 W1_Comp_2103
rename W1_Comp_Empl_3 W1_Comp_3103
rename W1_Comp_Empl_4 W1_Comp_4103
rename W1_Comp_Empl_5 W1_Comp_5103
rename W1_Comp_Empl_6 W1_Comp_6103
rename W1_Comp_Empl_7 W1_Comp_7103
rename W1_Comm_Envi_1 W1_Comm_17
rename W1_Comm_Envi_2 W1_Comm_27
rename W1_Comm_Envi_3 W1_Comm_37
rename W1_Comm_Envi_4 W1_Comm_47
rename W1_Comm_Envi_5 W1_Comm_57
rename W1_Comm_Envi_6 W1_Comm_67
rename W1_Comm_Envi_7 W1_Comm_77
rename W1_Comm_Empl_1 W1_Comm_1103
rename W1_Comm_Empl_2 W1_Comm_2103
rename W1_Comm_Empl_3 W1_Comm_3103
rename W1_Comm_Empl_4 W1_Comm_4103
rename W1_Comm_Empl_5 W1_Comm_5103
rename W1_Comm_Empl_6 W1_Comm_6103
rename W1_Comm_Empl_7 W1_Comm_7103
rename W1_Pos_Envi_1 W1_Pos_17
rename W1_Pos_Envi_2 W1_Pos_27
rename W1_Pos_Envi_3 W1_Pos_37
rename W1_Pos_Envi_4 W1_Pos_47
rename W1_Pos_Envi_5 W1_Pos_57
rename W1_Pos_Envi_6 W1_Pos_67
rename W1_Pos_Envi_7 W1_Pos_77
rename W1_Pos_Empl_1 W1_Pos_1103
rename W1_Pos_Empl_2 W1_Pos_2103
rename W1_Pos_Empl_3 W1_Pos_3103
rename W1_Pos_Empl_4 W1_Pos_4103
rename W1_Pos_Empl_5 W1_Pos_5103
rename W1_Pos_Empl_6 W1_Pos_6103
rename W1_Pos_Empl_7 W1_Pos_7103
rename W1_Comp_Crime_1 W1_Comp_112
rename W1_Comp_Crime_2 W1_Comp_212
rename W1_Comp_Crime_3 W1_Comp_312
rename W1_Comp_Crime_4 W1_Comp_412
rename W1_Comp_Crime_5 W1_Comp_512
rename W1_Comp_Crime_6 W1_Comp_612
rename W1_Comp_Crime_7 W1_Comp_712
rename W1_Comp_Tax_1 W1_Comp_1107
rename W1_Comp_Tax_2 W1_Comp_2107
rename W1_Comp_Tax_3 W1_Comp_3107
rename W1_Comp_Tax_4 W1_Comp_4107
rename W1_Comp_Tax_5 W1_Comp_5107
rename W1_Comp_Tax_6 W1_Comp_6107
rename W1_Comp_Tax_7 W1_Comp_7107
rename W1_Comm_Crime_1 W1_Comm_112
rename W1_Comm_Crime_2 W1_Comm_212
rename W1_Comm_Crime_3 W1_Comm_312
rename W1_Comm_Crime_4 W1_Comm_412
rename W1_Comm_Crime_5 W1_Comm_512
rename W1_Comm_Crime_6 W1_Comm_612
rename W1_Comm_Crime_7 W1_Comm_712
rename W1_Comm_Tax_1 W1_Comm_1107
rename W1_Comm_Tax_2 W1_Comm_2107
rename W1_Comm_Tax_3 W1_Comm_3107
rename W1_Comm_Tax_4 W1_Comm_4107
rename W1_Comm_Tax_5 W1_Comm_5107
rename W1_Comm_Tax_6 W1_Comm_6107
rename W1_Comm_Tax_7 W1_Comm_7107
rename W1_Pos_Crime_1 W1_Pos_112
rename W1_Pos_Crime_2 W1_Pos_212
rename W1_Pos_Crime_3 W1_Pos_312
rename W1_Pos_Crime_4 W1_Pos_412
rename W1_Pos_Crime_5 W1_Pos_512
rename W1_Pos_Crime_6 W1_Pos_612
rename W1_Pos_Crime_7 W1_Pos_712
rename W1_Pos_Tax_1 W1_Pos_1107
rename W1_Pos_Tax_2 W1_Pos_2107
rename W1_Pos_Tax_3 W1_Pos_3107
rename W1_Pos_Tax_4 W1_Pos_4107
rename W1_Pos_Tax_5 W1_Pos_5107
rename W1_Pos_Tax_6 W1_Pos_6107
rename W1_Pos_Tax_7 W1_Pos_7107

rename W2_Comp_Envi_1 W2_Comp_17 
rename W2_Comp_Envi_2 W2_Comp_27
rename W2_Comp_Envi_3 W2_Comp_37
rename W2_Comp_Envi_4 W2_Comp_47
rename W2_Comp_Envi_5 W2_Comp_57
rename W2_Comp_Envi_6 W2_Comp_67
rename W2_Comp_Envi_7 W2_Comp_77
rename W2_Comp_Empl_1 W2_Comp_1103
rename W2_Comp_Empl_2 W2_Comp_2103
rename W2_Comp_Empl_3 W2_Comp_3103
rename W2_Comp_Empl_4 W2_Comp_4103
rename W2_Comp_Empl_5 W2_Comp_5103
rename W2_Comp_Empl_6 W2_Comp_6103
rename W2_Comp_Empl_7 W2_Comp_7103
rename W2_Comm_Envi_1 W2_Comm_17
rename W2_Comm_Envi_2 W2_Comm_27
rename W2_Comm_Envi_3 W2_Comm_37
rename W2_Comm_Envi_4 W2_Comm_47
rename W2_Comm_Envi_5 W2_Comm_57
rename W2_Comm_Envi_6 W2_Comm_67
rename W2_Comm_Envi_7 W2_Comm_77
rename W2_Comm_Empl_1 W2_Comm_1103
rename W2_Comm_Empl_2 W2_Comm_2103
rename W2_Comm_Empl_3 W2_Comm_3103
rename W2_Comm_Empl_4 W2_Comm_4103
rename W2_Comm_Empl_5 W2_Comm_5103
rename W2_Comm_Empl_6 W2_Comm_6103
rename W2_Comm_Empl_7 W2_Comm_7103
rename W2_Pos_Envi_1 W2_Pos_17
rename W2_Pos_Envi_2 W2_Pos_27
rename W2_Pos_Envi_3 W2_Pos_37
rename W2_Pos_Envi_4 W2_Pos_47
rename W2_Pos_Envi_5 W2_Pos_57
rename W2_Pos_Envi_6 W2_Pos_67
rename W2_Pos_Envi_7 W2_Pos_77
rename W2_Pos_Empl_1 W2_Pos_1103
rename W2_Pos_Empl_2 W2_Pos_2103
rename W2_Pos_Empl_3 W2_Pos_3103
rename W2_Pos_Empl_4 W2_Pos_4103
rename W2_Pos_Empl_5 W2_Pos_5103
rename W2_Pos_Empl_6 W2_Pos_6103
rename W2_Pos_Empl_7 W2_Pos_7103
rename W2_Comp_Crime_1 W2_Comp_112
rename W2_Comp_Crime_2 W2_Comp_212
rename W2_Comp_Crime_3 W2_Comp_312
rename W2_Comp_Crime_4 W2_Comp_412
rename W2_Comp_Crime_5 W2_Comp_512
rename W2_Comp_Crime_6 W2_Comp_612
rename W2_Comp_Crime_7 W2_Comp_712
rename W2_Comp_Tax_1 W2_Comp_1107
rename W2_Comp_Tax_2 W2_Comp_2107
rename W2_Comp_Tax_3 W2_Comp_3107
rename W2_Comp_Tax_4 W2_Comp_4107
rename W2_Comp_Tax_5 W2_Comp_5107
rename W2_Comp_Tax_6 W2_Comp_6107
rename W2_Comp_Tax_7 W2_Comp_7107
rename W2_Comm_Crime_1 W2_Comm_112
rename W2_Comm_Crime_2 W2_Comm_212
rename W2_Comm_Crime_3 W2_Comm_312
rename W2_Comm_Crime_4 W2_Comm_412
rename W2_Comm_Crime_5 W2_Comm_512
rename W2_Comm_Crime_6 W2_Comm_612
rename W2_Comm_Crime_7 W2_Comm_712
rename W2_Comm_Tax_1 W2_Comm_1107
rename W2_Comm_Tax_2 W2_Comm_2107
rename W2_Comm_Tax_3 W2_Comm_3107
rename W2_Comm_Tax_4 W2_Comm_4107
rename W2_Comm_Tax_5 W2_Comm_5107
rename W2_Comm_Tax_6 W2_Comm_6107
rename W2_Comm_Tax_7 W2_Comm_7107
rename W2_Pos_Crime_1 W2_Pos_112
rename W2_Pos_Crime_2 W2_Pos_212
rename W2_Pos_Crime_3 W2_Pos_312
rename W2_Pos_Crime_4 W2_Pos_412
rename W2_Pos_Crime_5 W2_Pos_512
rename W2_Pos_Crime_6 W2_Pos_612
rename W2_Pos_Crime_7 W2_Pos_712
rename W2_Pos_Tax_1 W2_Pos_1107
rename W2_Pos_Tax_2 W2_Pos_2107
rename W2_Pos_Tax_3 W2_Pos_3107
rename W2_Pos_Tax_4 W2_Pos_4107
rename W2_Pos_Tax_5 W2_Pos_5107
rename W2_Pos_Tax_6 W2_Pos_6107
rename W2_Pos_Tax_7 W2_Pos_7107

rename w2_diversion_1 W2_diversion_1 
rename w2_diversion_2 W2_diversion_2 
rename w2_diversion_3 W2_diversion_3 

keep W1_* W2_* Condition id yob edu sex RecordedDate* StartDate* EndDate*

save threedimensions_unstacked.dta, replace




reshape long /// 
W1_Comp_1 W1_Comp_2 W1_Comp_3 W1_Comp_4 W1_Comp_5 W1_Comp_6 W1_Comp_7 ///
W1_Comm_1 W1_Comm_2 W1_Comm_3 W1_Comm_4 W1_Comm_5 W1_Comm_6 W1_Comm_7 ///
W1_Pos_1 W1_Pos_2 W1_Pos_3 W1_Pos_4 W1_Pos_5 W1_Pos_6 W1_Pos_7 ///
W2_Comp_1 W2_Comp_2 W2_Comp_3 W2_Comp_4 W2_Comp_5 W2_Comp_6 W2_Comp_7  ///
W2_Comm_1 W2_Comm_2 W2_Comm_3 W2_Comm_4 W2_Comm_5 W2_Comm_6 W2_Comm_7  ///
W2_Pos_1 W2_Pos_2 W2_Pos_3 W2_Pos_4 W2_Pos_5 W2_Pos_6 W2_Pos_7, i(id) j(issue)


// Stacking the data further, so cases become unique respondent-issue-party combinations
reshape long W1_Comp_ W2_Comp_ W1_Comm_ W2_Comm_ W1_Pos_ W2_Pos_ W1_ElectoralUtil_ W2_ElecUtil_ , i(id issue)
rename _j party
label define party_lbl 1 "ChrDem" 2 "Greens" 3 "FlemNat" 4 "Liberals" 5 "ExtLeft" 6 "Socialists" 7 "ExtRight"
label values party party_lbl
sort Condition id issue party
order W1_Comp_ W1_Comm_ W1_Pos_  W2_Comp_ W2_Comm_ W2_Pos_, after(party)
order Condition, after(party)

// Create a label for the condition var
label define Condition_lbl ///
	1 "CDV>Green ENVI COMP" ///
	2 "CDV>CDV ENVI COMP" ///
	3 "CDV>Green ENVI COMM" ///
	4 "CDV>CDV ENVI COMM" ///
	5 "CDV>Green ENVI POS" ///
	6 "CDV>CDV ENVI POS" ///
	7 "CDV>Soc EMPL COMP" ///
	8 "CDV>CDV EMPL COMP" ///
	9 "CDV>Soc EMPL COMM" ///
	10 "CDV>CDV EMPL COMM" ///
	11 "CDV>Soc EMPL POS" ///
	12 "CDV>CDV EMPL POS" ///
	13 "VB>NVA CRIME COMP" ///
	14 "VB>VB CRIME COMP" ///
	15 "VB>NVA CRIME COMM" ///
	16 "VB>VB CRIME COMM" ///
	17 "VB>NVA CRIME POS" ///
	18 "VB>VB CRIME POS" ///
	19 "NVA>VLD TAX COMP" ///
	20 "NVA>NVA TAX COMP" ///
	21 "NVA>VLD TAX COMM" ///
	22 "NVA>NVA TAX COMM" ///
	23 "NVA>VLD TAX POS" ///
	24 "NVA>NVA TAX POS"
label values Condition Condition_lbl

// Deleting issue-party combinations that were not asked of respondents (e.g. respondents in Conditions 1-12 only answered questions on employment and environment, not crime and tax)
drop if (issue == 12 | issue == 107) & (Condition < 13)
drop if !(issue == 12 | issue == 107) & (Condition >= 13)

// Generate difference between W2 and W1 score
gen Comm_diff = W2_Comm_ - W1_Comm_
gen Comp_diff = W2_Comp_ - W1_Comp_
gen Pos_diff = W2_Pos_ - W1_Pos_
order Comm_diff Comp_diff Pos_diff, after(W2_Pos_)

	
// Creating the three-category independent variables for target analysis
	gen comp_target = .
	label define comp_target_lbl 0 "Control" 1 "Comp Attack (Target)" 2 "Comp Praise (Target)"
	label values comp_target comp_target_lbl

	// Respondents' ratings of Socialists on Employment in Conditions 3-6 (non competence conditions) are control
	replace comp_target = 0 if (Condition >= 3 & Condition <= 6) & party == 6 & issue == 103
	// Respondents' ratings of Greens on Environment in Conditions 9-12 are control
	replace comp_target = 0 if (Condition >= 9 & Condition <= 12) & party == 2 & issue == 7
	// Respondents' ratings of Open VLD on Taxes in Conditions 15-18 are control
	replace comp_target = 0 if (Condition >= 15 & Condition <= 18) & party == 4 & issue == 107
	// Respondents' ratings of FleNat on Crime in Conditions 21-24 are control
	replace comp_target = 0 if (Condition >= 21 & Condition <= 24) & party == 3 & issue == 12
	
	// The four competence attack conditions (1, 7, 13 and 19) are set to value 1 for the relevant target party's ratings on the issue covered in the stimulus
	replace comp_target = 1 if (Condition == 1 & party == 2 & issue == 7) | (Condition == 7 & party == 6 & issue == 103) | (Condition == 13 & party == 3 & issue == 12) | (Condition == 19 & party == 4 & issue == 107)
	
	// The four competence praise conditions (2, 8, 14 and 20) are set to value 2 for the relevant target party's ratings on the issue covered in the stimulus
	replace comp_target = 2 if (Condition == 2 & party == 2 & issue == 7) | (Condition == 8 & party == 6 & issue == 103) | (Condition == 14 & party == 3 & issue == 12) | (Condition == 20 & party == 4 & issue == 107)
	
	tab Condition comp_target
	
	gen comm_target = .
	label define comm_target_lbl 0 "Control" 1 "Comm Attack (Target)" 2 "Comm Praise (Target)"
	label values comm_target comm_target_lbl

	// Respondents' ratings of Socialists on Employment in Conditions 1,2,5 and 6 (non commitment conditions) are control
	replace comm_target = 0 if (Condition == 1 | Condition == 2 | Condition == 5 | Condition == 6) & party == 6 & issue == 103
	// Respondents' ratings of Greens on Environment in Conditions 7, 8, 11, 12 (non commitment conditions are control
	replace comm_target = 0 if (Condition == 7 | Condition == 8 | Condition == 11 | Condition == 12) & party == 2 & issue == 7
	// Respondents' ratings of Open VLD on Taxes in Conditions 13, 14, 17, 18 are control
	replace comm_target = 0 if (Condition == 13 | Condition == 14 | Condition == 17 | Condition == 18) & party == 4 & issue == 107
	// Respondents' ratings of FleNat on Crime in Conditions 19, 20, 23, 24 are control
	replace comm_target = 0 if (Condition == 19 | Condition == 20 | Condition == 23 | Condition == 24) & party == 3 & issue == 12
	
	// The four commitment attack conditions (3, 9, 15 and 21) are set to value 1 for the relevant target party's ratings on the issue covered in the stimulus
	replace comm_target = 1 if (Condition == 3 & party == 2 & issue == 7) | (Condition == 9 & party == 6 & issue == 103) | (Condition == 15 & party == 3 & issue == 12) | (Condition == 21 & party == 4 & issue == 107)
	
	// The four commitment praise conditions (4, 10, 16 and 22) are set to value 2 for the relevant target party's ratings on the issue covered in the stimulus
	replace comm_target = 2 if (Condition == 4 & party == 2 & issue == 7) | (Condition == 10 & party == 6 & issue == 103) | (Condition == 16 & party == 3 & issue == 12) | (Condition == 22 & party == 4 & issue == 107)
	
	tab Condition comm_target	
	
	gen pos_target = .
	label define pos_target_lbl 0 "Control" 1 "Pos Attack (Target)" 2 "Pos Praise (Target)"
	label values pos_target pos_target_lbl

	// Respondents' ratings of Socialists on Employment in Conditions 1 to 4 (non position conditions) are control
	replace pos_target = 0 if (Condition == 1 | Condition == 2 | Condition == 3 | Condition == 4) & party == 6 & issue == 103
	// Respondents' ratings of Greens on Environment in Conditions 7 to 10 (non position conditions are control
	replace pos_target = 0 if (Condition == 7 | Condition == 8 | Condition == 9 | Condition == 10) & party == 2 & issue == 7
	// Respondents' ratings of Open VLD on Taxes in Conditions 13 to 16 are control
	replace pos_target = 0 if (Condition == 13 | Condition == 14 | Condition == 15 | Condition == 16) & party == 4 & issue == 107
	// Respondents' ratings of FleNat on Crime in Conditions 19 to 22 are control
	replace pos_target = 0 if (Condition == 19 | Condition == 20 | Condition == 21 | Condition == 22) & party == 3 & issue == 12
	
	// The four position attack conditions (5, 11, 17 and 23) are set to value 1 for the relevant target party's ratings on the issue covered in the stimulus
	replace pos_target = 1 if (Condition == 5 & party == 2 & issue == 7) | (Condition == 11 & party == 6 & issue == 103) | (Condition == 17 & party == 3 & issue == 12) | (Condition == 23 & party == 4 & issue == 107)
	
	// The four position praise conditions (6, 12, 18 and 24) are set to value 2 for the relevant target party's ratings on the issue covered in the stimulus
	replace pos_target = 2 if (Condition == 6 & party == 2 & issue == 7) | (Condition == 12 & party == 6 & issue == 103) | (Condition == 18 & party == 3 & issue == 12) | (Condition == 24 & party == 4 & issue == 107)
	
	tab Condition pos_target	
	
	order comp_target comm_target pos_target, after(Condition)
	
	gen comp_source = .
	label define comp_source_lbl 0 "Control" 1 "Comp Attack (Source)" 2 "Comp Praise (Source)"
	label values comp_source comp_source_lbl

	// Respondents' ratings of ChrDems on Employment in Conditions 3 to 6 (non competence conditions) are control
	replace comp_source = 0 if (Condition == 3 | Condition == 4 | Condition == 5 | Condition == 6) & party == 1 & issue == 103
	// Respondents' ratings of ChrDems on Environment in Conditions 9 to 12 (non competence conditions) are control
	replace comp_source = 0 if (Condition == 9 | Condition == 10 | Condition == 11 | Condition == 12) & party == 1 & issue == 7
	// Respondents' ratings of FleNat on Taxes in Conditions 15 to 18 are control
	replace comp_source = 0 if (Condition == 15 | Condition == 16 | Condition == 17 | Condition == 18) & party == 3 & issue == 107
	// Respondents' ratings of ExtRight on Crime in Conditions 21 to 24 are control
	replace comp_source = 0 if (Condition == 21 | Condition == 22 | Condition == 23 | Condition == 24) & party == 7 & issue == 12
	
	// The four competence attack conditions (1, 7, 13 and 19) are set to value 1 for the relevant source party's ratings on the issue covered in the stimulus
	replace comp_source = 1 if (Condition == 1 & party == 1 & issue == 7) | (Condition == 7 & party == 1 & issue == 103) | (Condition == 13 & party == 7 & issue == 12) | (Condition == 19 & party == 3 & issue == 107)
	
	// The four position praise conditions (2, 8, 14 and 20) are set to value 2 for the relevant source party's ratings on the issue covered in the stimulus
	replace comp_source = 2 if (Condition == 2 & party == 1 & issue == 7) | (Condition == 8 & party == 1 & issue == 103) | (Condition == 14 & party == 7 & issue == 12) | (Condition == 20 & party == 3 & issue == 107)
	
	tab Condition comp_source	

	gen comm_source = .
	label define comm_source_lbl 0 "Control" 1 "Comm Attack (Source)" 2 "Comm Praise (Source)"
	label values comm_source comm_source_lbl

	// Respondents' ratings of ChrDems on Employment in Conditions 1,2,5,6 (non commitment conditions) are control
	replace comm_source = 0 if (Condition == 1 | Condition == 2 | Condition == 5 | Condition == 6) & party == 1 & issue == 103
	// Respondents' ratings of ChrDems on Environment in Conditions 7,8,11,12 (non commitment conditions) are control
	replace comm_source = 0 if (Condition == 7 | Condition == 8 | Condition == 11 | Condition == 12) & party == 1 & issue == 7
	// Respondents' ratings of FleNat on Taxes in Conditions 13, 14, 17, 18 are control
	replace comm_source = 0 if (Condition == 13 | Condition == 14 | Condition == 17 | Condition == 18) & party == 3 & issue == 107
	// Respondents' ratings of ExtRight on Crime in Conditions 19, 20, 23, 24 are control
	replace comm_source = 0 if (Condition == 19 | Condition == 20 | Condition == 23 | Condition == 24) & party == 7 & issue == 12
	
	// The four commitment attack conditions (3,9,15,21) are set to value 1 for the relevant source party's ratings on the issue covered in the stimulus
	replace comm_source = 1 if (Condition == 3 & party == 1 & issue == 7) | (Condition == 9 & party == 1 & issue == 103) | (Condition == 15 & party == 7 & issue == 12) | (Condition == 21 & party == 3 & issue == 107)
	
	// The four position praise conditions (4,10,16,22) are set to value 2 for the relevant source party's ratings on the issue covered in the stimulus
	replace comm_source = 2 if (Condition == 4 & party == 1 & issue == 7) | (Condition == 10 & party == 1 & issue == 103) | (Condition == 16 & party == 7 & issue == 12) | (Condition == 22 & party == 3 & issue == 107)
	
	tab Condition comm_source	
	
	gen pos_source = .
	label define pos_source_lbl 0 "Control" 1 "Pos Attack (Source)" 2 "Pos Praise (Source)"
	label values pos_source pos_source_lbl

	// Respondents' ratings of ChrDems on Employment in Conditions 1,2,3,4 (non position conditions) are control
	replace pos_source = 0 if (Condition == 1 | Condition == 2 | Condition == 3 | Condition == 4) & party == 1 & issue == 103
	// Respondents' ratings of ChrDems on Environment in Conditions 7,8,9,10 (non commitment conditions) are control
	replace pos_source = 0 if (Condition == 7 | Condition == 8 | Condition == 9 | Condition == 10) & party == 1 & issue == 7
	// Respondents' ratings of FleNat on Taxes in Conditions 13, 14, 15,16 are control
	replace pos_source = 0 if (Condition == 13 | Condition == 14 | Condition == 15 | Condition == 16) & party == 3 & issue == 107
	// Respondents' ratings of ExtRight on Crime in Conditions 19, 20, 21, 22 are control
	replace pos_source = 0 if (Condition == 19 | Condition == 20 | Condition == 21 | Condition == 22) & party == 7 & issue == 12
	
	// The four commitment attack conditions (5,11,17,23) are set to value 1 for the relevant source party's ratings on the issue covered in the stimulus
	replace pos_source = 1 if (Condition == 5 & party == 1 & issue == 7) | (Condition == 11 & party == 1 & issue == 103) | (Condition == 17 & party == 7 & issue == 12) | (Condition == 23 & party == 3 & issue == 107)
	
	// The four position praise conditions (6,12,18,24) are set to value 2 for the relevant source party's ratings on the issue covered in the stimulus
	replace pos_source = 2 if (Condition == 6 & party == 1 & issue == 7) | (Condition == 12 & party == 1 & issue == 103) | (Condition == 18 & party == 7 & issue == 12) | (Condition == 24 & party == 3 & issue == 107)
	
	tab Condition pos_source	
	
	
	
	// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	// We create target 'other issue' variables: this allows us to assert whether the issue attack also 'spills over' to evaluations on the same dimension, but on the other issue we measured
	// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	
	gen comm_target_otherissue = .
	label define comm_target_otherissue_lbl 0 "Control" 1 "Comm Attack (Target)" 2 "Comm Praise (Target)"
	label values comm_target_otherissue comm_target_otherissue_lbl

	// The four commitment attack conditions (3, 9, 15 and 21) are set to value 1 for the relevant target party's ratings on the OTHER issue (that was NOT covered in the stimulus)
	replace comm_target_otherissue = 1 if (Condition == 3 & party == 2 & issue == 103) | (Condition == 9 & party == 6 & issue == 7) | (Condition == 15 & party == 3 & issue == 107) | (Condition == 21 & party == 4 & issue == 12)	
	
	// The four commitment praise conditions (4, 10, 16 and 22) are set to value 2 for the relevant target party's ratings on the OTHER issue (that was NOT covered in the stimulus)
	replace comm_target_otherissue = 2 if (Condition == 4 & party == 2 & issue == 103) | (Condition == 10 & party == 6 & issue == 7) | (Condition == 16 & party == 3 & issue == 107) | (Condition == 22 & party == 4 & issue == 12)
	
	// Respondents' ratings of Socialists on Environment in Conditions 1,2,5 and 6 (non commitment conditions) are control
	replace comm_target_otherissue = 0 if (Condition == 1 | Condition == 2 | Condition == 5 | Condition == 6) & party == 6 & issue == 7
	// Respondents' ratings of Greens on Employment in Conditions 7, 8, 11, 12 (non commitment conditions are control
	replace comm_target_otherissue = 0 if (Condition == 7 | Condition == 8 | Condition == 11 | Condition == 12) & party == 2 & issue == 103
	// Respondents' ratings of Open VLD on Crime in Conditions 13, 14, 17, 18 are control
	replace comm_target_otherissue = 0 if (Condition == 13 | Condition == 14 | Condition == 17 | Condition == 18) & party == 4 & issue == 12
	// Respondents' ratings of FleNat on Taxes in Conditions 19, 20, 23, 24 are control
	replace comm_target_otherissue = 0 if (Condition == 19 | Condition == 20 | Condition == 23 | Condition == 24) & party == 3 & issue == 107
	
	gen comp_target_otherissue = .
	label define comp_target_otherissue_lbl 0 "Control" 1 "Comp Attack (Target)" 2 "Comp Praise (Target)"
	label values comp_target_otherissue comp_target_otherissue_lbl
	
	// The four competence attack conditions (1, 7, 13 and 19) are set to value 1 for the relevant target party's ratings on the OTHER issue (that was NOT covered in the stimulus)
	replace comp_target_otherissue = 1 if (Condition == 1 & party == 2 & issue == 103) | (Condition == 7 & party == 6 & issue == 7) | (Condition == 13 & party == 3 & issue == 107) | (Condition == 19 & party == 4 & issue == 12)
	
	// The four competence praise conditions (2, 8, 14 and 20) are set to value 2 for the relevant target party's ratings on the OTHER issue (that was NOT covered in the stimulus)
	replace comp_target_otherissue = 2 if (Condition == 2 & party == 2 & issue == 103) | (Condition == 8 & party == 6 & issue == 7) | (Condition == 14 & party == 3 & issue == 107) | (Condition == 20 & party == 4 & issue == 12)
	
	// Respondents' ratings of Socialists on Environment in Conditions 3-6 (non competence conditions) are control
	replace comp_target_otherissue = 0 if (Condition >= 3 & Condition <= 6) & party == 6 & issue == 7
	// Respondents' ratings of Greens on Employment in Conditions 9-12 are control
	replace comp_target_otherissue = 0 if (Condition >= 9 & Condition <= 12) & party == 2 & issue == 103
	// Respondents' ratings of Open VLD on Crime in Conditions 15-18 are control
	replace comp_target_otherissue = 0 if (Condition >= 15 & Condition <= 18) & party == 4 & issue == 12
	// Respondents' ratings of FleNat on Taxes in Conditions 21-24 are control
	replace comp_target_otherissue = 0 if (Condition >= 21 & Condition <= 24) & party == 3 & issue == 107
	

	gen pos_target_otherissue = .
	label define pos_target_otherissue 0 "Control" 1 "Pos Attack (Target)" 2 "Pos Praise (Target)"
	label values pos_target_otherissue pos_target_lbl
	label var pos_target_otherissue "Treatment effect on the other issue that was measured but not manipulated"

	// The four position attack conditions (5, 11, 17 and 23) are set to value 1 for the relevant target party's ratings on the OTHER issue (that was NOT covered in the stimulus)
	replace pos_target_otherissue = 1 if (Condition == 5 & party == 2 & issue == 103) | (Condition == 11 & party == 6 & issue == 7) | (Condition == 17 & party == 3 & issue == 107) | (Condition == 23 & party == 4 & issue == 12)
	// The four position praise conditions (6, 12, 18 and 24) are set to value 2 for the relevant target party's ratings on the OTHER issue (that was NOT covered in the stimulus)
	replace pos_target_otherissue = 2 if (Condition == 6 & party == 2 & issue == 103) | (Condition == 12 & party == 6 & issue == 7) | (Condition == 18 & party == 3 & issue == 107) | (Condition == 24 & party == 4 & issue == 12)	
	
	// Respondents' ratings of Socialists on Environment in Conditions 1 to 4 (non position conditions) are control
	replace pos_target_otherissue = 0 if (Condition == 1 | Condition == 2 | Condition == 3 | Condition == 4) & party == 6 & issue == 7
	// Respondents' ratings of Greens on Employment in Conditions 7 to 10 (non position conditions are control
	replace pos_target_otherissue = 0 if (Condition == 7 | Condition == 8 | Condition == 9 | Condition == 10) & party == 2 & issue == 103
	// Respondents' ratings of Open VLD on Crime in Conditions 13 to 16 are control
	replace pos_target_otherissue = 0 if (Condition == 13 | Condition == 14 | Condition == 15 | Condition == 16) & party == 4 & issue == 12
	// Respondents' ratings of FleNat on Taxes in Conditions 19 to 22 are control
	replace pos_target_otherissue = 0 if (Condition == 19 | Condition == 20 | Condition == 21 | Condition == 22) & party == 3 & issue == 107
	

	label define issue_lbl 7 "Environment" 12 "Crime" 103 "Employment" 107 "Taxes"
	label values issue issue_lbl
	
	
save Threedimensions_stacked.dta, replace


	sort Condition id issue party
	
	// 0 control 1 attack dummies
	g comm_target_d = .
	recode comm_target_d (.=1) if comm_target == 1
	recode comm_target_d (.=0) if comm_target == 0
	
	g comp_target_d = .
	recode comp_target_d (.=1) if comp_target == 1
	recode comp_target_d (.=0) if comp_target == 0 
	
	g pos_target_d = .
	recode pos_target_d (.=1) if pos_target == 1
	recode pos_target_d (.=0) if pos_target == 0
	 
	order comm_target_d comp_target_d pos_target_d, after(Condition)
	
save Threedimensions_stacked.dta, replace

	// Generating vote choice variable in W1 (control)
	gen d_votechoiceW1 = .
	replace d_votechoiceW1 = 0 if !missing(W1_VoteChoice)
	replace d_votechoiceW1 = 1 if party == 1 & W1_VoteChoice == 1 // CDV
	replace d_votechoiceW1 = 1 if party == 2 & W1_VoteChoice == 2 // Groen
	replace d_votechoiceW1 = 1 if party == 3 & W1_VoteChoice == 3 // NVA
	replace d_votechoiceW1 = 1 if party == 4 & W1_VoteChoice == 4 // VLD
	replace d_votechoiceW1 = 1 if party == 5 & W1_VoteChoice == 5 // PVDA
	replace d_votechoiceW1 = 1 if party == 6 & W1_VoteChoice == 6 // spa
	replace d_votechoiceW1 = 1 if party == 7 & W1_VoteChoice == 7 // VB

	// Drop if missing party preference W1
	drop if missing(d_votechoiceW1)
	 
	 // Adding time between waves
	gen timebetweenwaves = EndDate_W2 - EndDate_W1
	
	// Adding dummies for party preference for attacker and target
	gen partypref_attacker = 0 if !missing(W1_VoteChoice)
	replace partypref_attacker = 1 if (W1_VoteChoice == 1) & (Condition == 1 | Condition == 3 | Condition == 5 | Condition == 7 | Condition == 9 | Condition == 11)
	replace partypref_attacker = 1 if (W1_VoteChoice == 7) & (Condition == 13 | Condition == 15 | Condition == 17)
	replace partypref_attacker = 1 if (W1_VoteChoice == 3) & (Condition == 19 | Condition == 21 | Condition == 23)
		
	gen partypref_target = 0 if !missing(W1_VoteChoice)
	replace partypref_target = 1 if (W1_VoteChoice == 2) & (Condition == 1 | Condition == 3 | Condition == 5)
	replace partypref_target = 1 if (W1_VoteChoice == 6) & (Condition == 7 | Condition == 9 | Condition == 11)
	replace partypref_target = 1 if (W1_VoteChoice == 3) & (Condition == 13 | Condition == 15 | Condition == 17)
	replace partypref_target = 1 if (W1_VoteChoice == 4) & (Condition == 19 | Condition == 21 | Condition == 23)
	
	gen partypref_3cat = .
	replace partypref_3cat = 1 if partypref_attacker == 0 & partypref_target == 0
	replace partypref_3cat = 2 if partypref_attacker == 1 & partypref_target == 0
	replace partypref_3cat = 3 if partypref_attacker == 0 & partypref_target == 1
	label define partpref_3cat_lbl 1 "No PP for attacker/target" 2 "PP for attacker" 3 "PP for target"
	label values partypref_3cat partpref_3cat_lbl
	tab partypref_3cat

	// Adding dummy indicating respondents that are included in the analysis
	regress W2_Comm_ comm_target_d i.issue W1_Comm_, cluster(id)
	gen included_commitment = e(sample)
	regress W2_Comp_ comp_target_d i.issue W1_Comp_, cluster(id)
	gen included_competence = e(sample)
	regress W2_Pos_ pos_target_d i.issue W1_Pos_, cluster(id)
	gen included_position = e(sample)
	gen included_any_analysis = (included_commitment == 1 | included_competence == 1 | included_position == 1)
	
save "Threedimensions_stacked.dta", replace


// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// ANALYSIS
// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////

// Note: appendix tables are included in either methods / results sections of the code
// Note: we used the "outreg" package for stata to export the model results. If you do not have this package available, simply delete the "outreg" commands to avoid getting errors

// Methods section
// //////////////////////////////////////////

	// Response in wave 1 and 2
	use threedimensions_unstacked.dta, clear
	tab EndDate_W1
	
	// Table 1 - N per condition
	use Threedimensions_stacked.dta, clear
		
	collapse (first) Condition (max) included*, by(id)
	label var Condition Condition

	tab Condition if included_any_analysis == 1
			
	// Sociodemos 
	use Threedimensions_stacked.dta, clear
	collapse (first) Condition yob edu sex W1_LeftRight_1 W1_PolInterest_1 W1_VoteChoice (max) included*, by(id)
	// fixing the yob variable
	
	gen yob_rc = .
	replace yob_rc = 2000	if yob == 1
	replace yob_rc = 1999	if yob == 2
	replace yob_rc = 1998	if yob == 3
	replace yob_rc = 1997	if yob == 4
	replace yob_rc = 1996	if yob == 5
	replace yob_rc = 1995	if yob == 6
	replace yob_rc = 1994	if yob == 7
	replace yob_rc = 1993	if yob == 8
	replace yob_rc = 1992	if yob == 9
	replace yob_rc = 1991	if yob == 10
	replace yob_rc = 1990	if yob == 11
	replace yob_rc = 1989	if yob == 12
	replace yob_rc = 1988	if yob == 13
	replace yob_rc = 1987	if yob == 14
	replace yob_rc = 1986	if yob == 15
	replace yob_rc = 1985	if yob == 16
	replace yob_rc = 1984	if yob == 17
	replace yob_rc = 1983	if yob == 18
	replace yob_rc = 1982	if yob == 19
	replace yob_rc = 1981	if yob == 20
	replace yob_rc = 1980	if yob == 21
	replace yob_rc = 1979	if yob == 22
	replace yob_rc = 1978	if yob == 23
	replace yob_rc = 1977	if yob == 24
	replace yob_rc = 1976	if yob == 25
	replace yob_rc = 1975	if yob == 26
	replace yob_rc = 1974	if yob == 27
	replace yob_rc = 1973	if yob == 28
	replace yob_rc = 1972	if yob == 29
	replace yob_rc = 1971	if yob == 30
	replace yob_rc = 1970	if yob == 31
	replace yob_rc = 1969	if yob == 32
	replace yob_rc = 1968	if yob == 33
	replace yob_rc = 1967	if yob == 34
	replace yob_rc = 1966	if yob == 35
	replace yob_rc = 1965	if yob == 36
	replace yob_rc = 1964	if yob == 37
	replace yob_rc = 1963	if yob == 38
	replace yob_rc = 1962	if yob == 39
	replace yob_rc = 1961	if yob == 40
	replace yob_rc = 1960	if yob == 41
	replace yob_rc = 1959	if yob == 42
	replace yob_rc = 1958	if yob == 43
	replace yob_rc = 1957	if yob == 44
	replace yob_rc = 1956	if yob == 45
	replace yob_rc = 1955	if yob == 46
	replace yob_rc = 1954	if yob == 47
	replace yob_rc = 1953	if yob == 48
	replace yob_rc = 1952	if yob == 49
	replace yob_rc = 1951	if yob == 50
	replace yob_rc = 1950	if yob == 51
	replace yob_rc = 1949	if yob == 52
	replace yob_rc = 1948	if yob == 53
	replace yob_rc = 1947	if yob == 54
	replace yob_rc = 1946	if yob == 55
	replace yob_rc = 1945	if yob == 56
	replace yob_rc = 1944	if yob == 57
	replace yob_rc = 1943	if yob == 58
	replace yob_rc = 1942	if yob == 59
	replace yob_rc = 1941	if yob == 60
	replace yob_rc = 1940	if yob == 61
	replace yob_rc = 1939	if yob == 62
	replace yob_rc = 1938	if yob == 63
	replace yob_rc = 1937	if yob == 64
	replace yob_rc = 1936	if yob == 65
	replace yob_rc = 1935	if yob == 66
	replace yob_rc = 1934	if yob == 67
	replace yob_rc = 1933	if yob == 68
	replace yob_rc = 1932	if yob == 69
	replace yob_rc = 1931	if yob == 70
	replace yob_rc = 1930	if yob == 71
	replace yob_rc = 1929	if yob == 72
	replace yob_rc = 1928	if yob == 73
	replace yob_rc = .	    if yob == 99
	replace yob_rc = .   	if yob == 101
	gen age = 2018 - yob_rc	
	gen age_3 = .
	replace age_3 = 1 if age <= 29
	replace age_3 = 2 if age >= 30 & age <= 44
	replace age_3 = 3 if age >= 45	
	tab age_3 if included_any_analysis == 1
	
	replace sex = . if sex == 99
	tab sex  if included_any_analysis == 1
	
	gen edu_3 = .
	replace edu_3 = 1 if edu == 1 | edu == 2
	replace edu_3 = 2 if edu >= 3 & edu <= 8 
	replace edu_3 = 3 if edu == 9 | edu == 10	
	tab edu_3  if included_any_analysis == 1	
	
	// Randomization checks
	oneway age Condition if included_any_analysis == 1
	tab Condition sex if included_any_analysis == 1, row nofreq chi2
	tab Condition edu_3 if included_any_analysis == 1, row nofreq chi2
	oneway W1_LeftRight_1 Condition if included_any_analysis == 1
	oneway W1_PolInterest_1 Condition if included_any_analysis == 1

	// TABLE A1 - Vote choice in 2014 elections in sample / population
	tab W1_VoteChoice if included_any_analysis == 1

	// TABLE A2 - Political interest and Left-Right in sample / Partirep 2014 (note that this requires another dataset (Partirep2014) for the analysis
	sum W1_LeftRight_1 W1_PolInterest_1 if included_any_analysis == 1	
	
	/*
	use "Partirep14_Complete.dta" , clear
	tab V34
	tab V34, nolabel
	replace V34 = . if V34 == 99
	mean V34 if REGION == 1 & !missing(V40)
	tab V40
	tab V40, nolabel
	replace V40 = . if V40 == 99
	mean V40 if REGION == 1 & !missing(V34)
	*/

	// TABLE A3 - IO perceptions amongst the sample
	use Threedimensions_stacked.dta, clear	
	by id, sort: egen included_perid = max(included_any_analysis)
	by party, sort: sum W1_Pos_ W1_Comp_ W1_Comm_ if issue == 7 & included_perid == 1
	by party, sort: sum W1_Pos_ W1_Comp_ W1_Comm_ if issue == 103 & included_perid == 1
	by party, sort: sum W1_Pos_ W1_Comp_ W1_Comm_ if issue == 12 & included_perid == 1
	by party, sort: sum W1_Pos_ W1_Comp_ W1_Comm_ if issue == 107 & included_perid == 1

	// TABLE A4 - Salience of issues
	use Threedimensions_stacked.dta, clear
	collapse (first)  W1_IssueSalience_* (max) included_any_analysis, by(id)
	sum W1_IssueSalience* if included_any_analysis == 1
		
	// TABLE A5 - Manipulation check
	use Threedimensions_stacked.dta, clear	
	collapse (first) Condition W2_ThreeDimMentioned_1 W2_ThreeDimMentioned_2 W2_ThreeDimMentioned_3 W2_StimRealism (max) included*, by(id)	
	generate competence_condition = (Condition == 1 | Condition == 7 | Condition == 13 | Condition == 19)
	generate commitment_condition = (Condition == 3 | Condition == 9 | Condition == 15 | Condition == 21)
	generate position_condition = (Condition == 5 | Condition == 11 | Condition == 17 | Condition == 23)	
	ttest W2_ThreeDimMentioned_1 if included_any_analysis == 1 & (commitment_condition == 1 | competence_condition == 1), by(competence_condition)
	ttest W2_ThreeDimMentioned_1 if included_any_analysis == 1 & (position_condition == 1 | competence_condition == 1), by(competence_condition)
	ttest W2_ThreeDimMentioned_2 if included_any_analysis == 1 & (commitment_condition == 1 | competence_condition == 1), by(commitment_condition)
	ttest W2_ThreeDimMentioned_2 if included_any_analysis == 1 & (commitment_condition == 1 | position_condition == 1), by(commitment_condition)
	ttest W2_ThreeDimMentioned_3 if included_any_analysis == 1 & (commitment_condition == 1 | position_condition == 1), by(position_condition)
	ttest W2_ThreeDimMentioned_3 if included_any_analysis == 1 & (competence_condition == 1 | position_condition == 1), by(position_condition)

	// Did respondents see similar articles appear elsewhere?
	tab W2_StimRealism if included_any_analysis == 1 
		
	// Timing of the waves
	use Threedimensions_stacked.dta, clear
	collapse (first) Condition yob edu sex StartDate_W1 EndDate_W1 RecordedDate_W1 StartDate_W2 EndDate_W2 RecordedDate_W2 timebetweenwaves (max) included*, by(id)
	tab timebetweenwaves if included_any_analysis == 1
	sum timebetweenwaves if included_any_analysis == 1
		
	// Correlations of three dimensions
	use Threedimensions_stacked.dta, clear
	pwcorr W2_Comm_ W2_Comp_ W2_Pos_ if included_any_analysis == 1 , sig
	sum W2_Comm_ W2_Comp_ W2_Pos_ if included_any_analysis == 1 
	tab EndDate_W2 if included_any_analysis == 1
	tab EndDate_W1 if included_any_analysis == 1
	
	
	
// Results section
// //////////////////////////////////////////

	// TABLE A6 - bivariate tests
	use Threedimensions_stacked.dta, clear

	ttest Pos_diff if included_any_analysis == 1 & issue == 7, by(pos_target_d)
	ttest Pos_diff if included_any_analysis == 1 & issue == 103, by(pos_target_d)
	ttest Pos_diff if included_any_analysis == 1 & issue == 12, by(pos_target_d)
	ttest Pos_diff if included_any_analysis == 1 & issue == 107, by(pos_target_d)	
	
	ttest Comp_diff if included_any_analysis == 1 &  issue == 7, by(pos_target_d)
	ttest Comp_diff if included_any_analysis == 1 &  issue == 103, by(pos_target_d)
	ttest Comp_diff if included_any_analysis == 1 &  issue == 12, by(pos_target_d)
	ttest Comp_diff if included_any_analysis == 1 &  issue == 107, by(pos_target_d)
	
	ttest Comm_diff if included_any_analysis == 1 &  issue == 7, by(pos_target_d)
	ttest Comm_diff if included_any_analysis == 1 &  issue == 103, by(pos_target_d)
	ttest Comm_diff if included_any_analysis == 1 &  issue == 12, by(pos_target_d)
	ttest Comm_diff if included_any_analysis == 1 &  issue == 107, by(pos_target_d)
	
	ttest Pos_diff if (issue == 7 | issue == 103 | issue == 12 | issue == 107) & included_any_analysis == 1, by(pos_target_d)
	ttest Comp_diff if (issue == 7 | issue == 103 | issue == 12 | issue == 107) & included_any_analysis == 1, by(pos_target_d)
	ttest Comm_diff if (issue == 7 | issue == 103 | issue == 12 | issue == 107) & included_any_analysis == 1, by(pos_target_d)

	ttest Pos_diff if included_any_analysis == 1 &  issue == 7, by(comp_target_d)
	ttest Pos_diff if included_any_analysis == 1 &  issue == 103, by(comp_target_d)
	ttest Pos_diff if included_any_analysis == 1 &  issue == 12, by(comp_target_d)
	ttest Pos_diff if included_any_analysis == 1 &  issue == 107, by(comp_target_d)
	
	ttest Comp_diff if included_any_analysis == 1 &  issue == 7, by(comp_target_d)
	ttest Comp_diff if included_any_analysis == 1 &  issue == 103, by(comp_target_d)
	ttest Comp_diff if included_any_analysis == 1 &  issue == 12, by(comp_target_d)
	ttest Comp_diff if included_any_analysis == 1 &  issue == 107, by(comp_target_d)

	ttest Comm_diff if included_any_analysis == 1 &  issue == 7, by(comp_target_d)
	ttest Comm_diff if included_any_analysis == 1 &  issue == 103, by(comp_target_d)
	ttest Comm_diff if included_any_analysis == 1 &  issue == 12, by(comp_target_d)
	ttest Comm_diff if included_any_analysis == 1 &  issue == 107, by(comp_target_d)

	ttest Pos_diff if (issue == 7 | issue == 103 | issue == 12 | issue == 107) & included_any_analysis == 1, by(comp_target_d)
	ttest Comp_diff if (issue == 7 | issue == 103 | issue == 12 | issue == 107) & included_any_analysis == 1, by(comp_target_d)
	ttest Comm_diff if (issue == 7 | issue == 103 | issue == 12 | issue == 107) & included_any_analysis == 1, by(comp_target_d)

	ttest Pos_diff if included_any_analysis == 1 &  issue == 7, by(comm_target_d)
	ttest Pos_diff if included_any_analysis == 1 &  issue == 103, by(comm_target_d)
	ttest Pos_diff if included_any_analysis == 1 &  issue == 12, by(comm_target_d)
	ttest Pos_diff if included_any_analysis == 1 &  issue == 107, by(comm_target_d)		

	ttest Comp_diff if included_any_analysis == 1 &  issue == 7, by(comm_target_d)
	ttest Comp_diff if included_any_analysis == 1 &  issue == 103, by(comm_target_d)
	ttest Comp_diff if included_any_analysis == 1 &  issue == 12, by(comm_target_d)
	ttest Comp_diff if included_any_analysis == 1 &  issue == 107, by(comm_target_d)
	
	ttest Comm_diff if included_any_analysis == 1 &  issue == 7, by(comm_target_d)
	ttest Comm_diff if included_any_analysis == 1 &  issue == 103, by(comm_target_d)
	ttest Comm_diff if included_any_analysis == 1 &  issue == 12, by(comm_target_d)
	ttest Comm_diff if included_any_analysis == 1 &  issue == 107, by(comm_target_d)

	ttest Pos_diff if (issue == 7 | issue == 103 | issue == 12 | issue == 107) & included_any_analysis == 1, by(comm_target_d)
	ttest Comp_diff if (issue == 7 | issue == 103 | issue == 12 | issue == 107) & included_any_analysis == 1, by(comm_target_d)
	ttest Comm_diff if (issue == 7 | issue == 103 | issue == 12 | issue == 107) & included_any_analysis == 1, by(comm_target_d)	
	
	// TABLE 2 - multivariate direct effects models
	use Threedimensions_stacked.dta, clear
	
	regress W2_Pos_ pos_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_table2_m1",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	regress W2_Comp_ comp_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_table2_m2",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	regress W2_Comm_ comm_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_table2_m3",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	
	regress W2_Comp_ pos_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_table2_m4",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	regress W2_Comm_ pos_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_table2_m5",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	
	regress W2_Pos_ comp_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_table2_m6",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	regress W2_Comm_ comp_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_table2_m7",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	
	regress W2_Pos_ comm_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_table2_m8",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	regress W2_Comp_ comm_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_table2_m9",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)

	// IN TEXT - Are effects of position/competence significantly different from each other?
	regress W2_Pos_ pos_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if included_any_analysis == 1
	est sto model1
	regress W2_Comm_ comm_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if included_any_analysis == 1
	est sto model2	
	suest model1 model2, cluster(id)
	test ([model1_mean]pos_target_d=[model2_mean]comm_target_d)
	
	regress W2_Pos_ pos_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if included_any_analysis == 1
	est sto model3
	regress W2_Comp_ comp_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if included_any_analysis == 1
	est sto model4	
	suest model3 model4, cluster(id)
	test ([model3_mean]pos_target_d=[model4_mean]comp_target_d)
		
	regress W2_Comm_ comm_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if included_any_analysis == 1
	est sto model5
	regress W2_Comp_ comp_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if included_any_analysis == 1
	est sto model6	
	suest model5 model6, cluster(id)
	test ([model5_mean]comm_target_d=[model6_mean]comp_target_d)

	// TABLE 3 + TABLE A7 - interaction with party preference	
	regress W2_Pos_ b1.partypref_3cat##i.pos_target_d i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_tableA7_m1",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	margins , dydx(pos_target_d) at(partypref_3cat = (1 2 3)) atmeans noatlegend
	regress W2_Comp_ b1.partypref_3cat##i.comp_target_d i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_tableA7_m2",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	margins , dydx(comp_target_d) at(partypref_3cat = (1 2 3)) atmeans noatlegend
	regress W2_Comm_ b1.partypref_3cat##i.comm_target_d i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_tableA7_m3",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	margins , dydx(comm_target_d) at(partypref_3cat = (1 2 3)) atmeans noatlegend
	regress W2_Comp_ b1.partypref_3cat##i.pos_target_d i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_tableA7_m4",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	margins , dydx(pos_target_d) at(partypref_3cat = (1 2 3)) atmeans noatlegend
	regress W2_Comm_ b1.partypref_3cat##i.pos_target_d i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_tableA7_m5",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	margins , dydx(pos_target_d) at(partypref_3cat = (1 2 3)) atmeans noatlegend
	regress W2_Pos_ b1.partypref_3cat##i.comp_target_d i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_tableA7_m6",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	margins , dydx(comp_target_d) at(partypref_3cat = (1 2 3)) atmeans noatlegend
	regress W2_Comm_ b1.partypref_3cat##i.comp_target_d i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_tableA7_m7",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	margins , dydx(comp_target_d) at(partypref_3cat = (1 2 3)) atmeans noatlegend
	regress W2_Pos_ b1.partypref_3cat##i.comm_target_d i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_tableA7_m8",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	margins , dydx(comm_target_d) at(partypref_3cat = (1 2 3)) atmeans noatlegend
	regress W2_Comp_ b1.partypref_3cat##i.comm_target_d i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_tableA7_m9",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	margins , dydx(comm_target_d) at(partypref_3cat = (1 2 3)) atmeans noatlegend

	// TABLE 4 + TABLE A8 - Issue interactions
	regress W2_Pos_ i.issue##i.pos_target_d b1.partypref_3cat W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_tableA8_m1",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	margins , dydx(pos_target_d) at(issue = (7 12 103 107)) atmeans noatlegend
	regress W2_Comp_ i.issue##i.comp_target_d b1.partypref_3cat W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_tableA8_m2",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	margins , dydx(comp_target_d) at(issue = (7 12 103 107)) atmeans noatlegend
	regress W2_Comm_ i.issue##i.comm_target_d b1.partypref_3cat W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_tableA8_m3",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	margins , dydx(comm_target_d) at(issue = (7 12 103 107)) atmeans noatlegend
	regress W2_Comp_ i.issue##i.pos_target_d b1.partypref_3cat W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_tableA8_m4",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	margins , dydx(pos_target_d) at(issue = (7 12 103 107)) atmeans noatlegend
	regress W2_Comm_ i.issue##i.pos_target_d b1.partypref_3cat W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_tableA8_m5",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	margins , dydx(pos_target_d) at(issue = (7 12 103 107)) atmeans noatlegend
	regress W2_Pos_ i.issue##i.comp_target_d b1.partypref_3cat W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_tableA8_m6",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	margins , dydx(comp_target_d) at(issue = (7 12 103 107)) atmeans noatlegend
	regress W2_Comm_ i.issue##i.comp_target_d b1.partypref_3cat W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_tableA8_m7",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	margins , dydx(comp_target_d) at(issue = (7 12 103 107)) atmeans noatlegend
	regress W2_Pos_ i.issue##i.comm_target_d b1.partypref_3cat W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_tableA8_m8",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	margins , dydx(comm_target_d) at(issue = (7 12 103 107)) atmeans noatlegend
	regress W2_Comp_ i.issue##i.comm_target_d b1.partypref_3cat W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_tableA8_m9",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	margins , dydx(comm_target_d) at(issue = (7 12 103 107)) atmeans noatlegend

	// TABLE A9 - Excluding employment
	regress W2_Pos_ pos_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if issue != 103 & included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_robust_no_empl_m1",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	regress W2_Comp_ comp_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if issue != 103 & included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_robust_no_empl_m2",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	regress W2_Comm_ comm_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if issue != 103 & included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_robust_no_empl_m3",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	regress W2_Comp_ pos_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if issue != 103 & included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_robust_no_empl_m4",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	regress W2_Comm_ pos_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if issue != 103 & included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_robust_no_empl_m5",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	regress W2_Pos_ comp_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if issue != 103 & included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_robust_no_empl_m6",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	regress W2_Comm_ comp_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if issue != 103 & included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_robust_no_empl_m7",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	regress W2_Pos_ comm_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if issue != 103 & included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_robust_no_empl_m8",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	regress W2_Comp_ comm_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if issue != 103 & included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_robust_no_empl_m9",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)

	// TABLE A10 - Excluding the environment
	regress W2_Pos_ pos_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if issue != 7 & included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_robust_no_envir_m1",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	regress W2_Comp_ comp_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if issue != 7 & included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_robust_no_envir_m2",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	regress W2_Comm_ comm_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if issue != 7 & included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_robust_no_envir_m3",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	regress W2_Comp_ pos_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if issue != 7 & included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_robust_no_envir_m4",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	regress W2_Comm_ pos_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if issue != 7 & included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_robust_no_envir_m5",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	regress W2_Pos_ comp_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if issue != 7 & included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_robust_no_envir_m6",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	regress W2_Comm_ comp_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if issue != 7 & included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_robust_no_envir_m7",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	regress W2_Pos_ comm_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if issue != 7 & included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_robust_no_envir_m8",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	regress W2_Comp_ comm_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if issue != 7 & included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_robust_no_envir_m9",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)

	// TABLE A11 - Excluding crime
	regress W2_Pos_ pos_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if issue != 12 & included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_robust_no_crime_m1",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	regress W2_Comp_ comp_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if issue != 12 & included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_robust_no_crime_m2",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	regress W2_Comm_ comm_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if issue != 12 & included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_robust_no_crime_m3",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	regress W2_Comp_ pos_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if issue != 12 & included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_robust_no_crime_m4",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	regress W2_Comm_ pos_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if issue != 12 & included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_robust_no_crime_m5",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	regress W2_Pos_ comp_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if issue != 12 & included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_robust_no_crime_m6",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	regress W2_Comm_ comp_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if issue != 12 & included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_robust_no_crime_m7",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	regress W2_Pos_ comm_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if issue != 12 & included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_robust_no_crime_m8",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	regress W2_Comp_ comm_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if issue != 12 & included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_robust_no_crime_m9",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)

	// TABLE A12 - Excluding taxes
	regress W2_Pos_ pos_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if issue != 107 & included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_robust_no_tax_m1",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	regress W2_Comp_ comp_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if issue != 107 & included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_robust_no_tax_m2",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	regress W2_Comm_ comm_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if issue != 107 & included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_robust_no_tax_m3",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	regress W2_Comp_ pos_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if issue != 107 & included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_robust_no_tax_m4",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	regress W2_Comm_ pos_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if issue != 107 & included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_robust_no_tax_m5",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	regress W2_Pos_ comp_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if issue != 107 & included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_robust_no_tax_m6",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	regress W2_Comm_ comp_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if issue != 107 & included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_robust_no_tax_m7",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	regress W2_Pos_ comm_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if issue != 107 & included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_robust_no_tax_m8",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	regress W2_Comp_ comm_target_d partypref_attacker partypref_target i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves if issue != 107 & included_any_analysis == 1, cluster(id)
	outreg2 using "threedimensions_robust_no_tax_m9",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)


	// TABLE A13 - spillover effects across issues

	g pos_target_otherissue_d = .
	recode pos_target_otherissue_d (.=1) if pos_target_otherissue == 1
	recode pos_target_otherissue_d (.=0) if pos_target_otherissue == 0
	
	g comp_target_otherissue_d = .
	recode comp_target_otherissue_d (.=1) if comp_target_otherissue == 1
	recode comp_target_otherissue_d (.=0) if comp_target_otherissue == 0

	g comm_target_otherissue_d = .
	recode comm_target_otherissue_d (.=1) if comm_target_otherissue == 1
	recode comm_target_otherissue_d (.=0) if comm_target_otherissue == 0

	regress W2_Pos_ pos_target_otherissue_d i.partypref_3cat i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves, cluster(id)
	outreg2 using "threedimensions_tableA13_m1",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	regress W2_Comp_ comp_target_otherissue_d i.partypref_3cat i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves, cluster(id)
	outreg2 using "threedimensions_tableA13_m2",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)
	regress W2_Comm_ comm_target_otherissue_d i.partypref_3cat i.issue W1_Pos_ W1_Comp_ W1_Comm_ timebetweenwaves, cluster(id)
	outreg2 using "threedimensions_tableA13_m3",  word dec(2) replace alpha(0.001, 0.01, 0.05, 0.10) symbol(***,**,*,+)

// /////////////////////////////////////////////////////////////////////////////////////////////////////
// END OF ANALYSIS
// /////////////////////////////////////////////////////////////////////////////////////////////////////